package com.tjp.oss.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.tjp.oss.service.FileService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: jz-club
 * @description: 文件控制器类
 * @author: aaronTang
 * @create: 2024-03-07
 */
@RestController
@RefreshScope
public class FileController {

    @Resource
    private FileService fileService;


    @Value("${custom.type}")
    private String storangeType;

    @RequestMapping("/testGetAllBucket")
    public String testGetAllBucket() throws Exception {

        List<String> allButket = fileService.getAllButket();

        return allButket.get(0);
    }


    @RequestMapping("/testNacos")
    public String testNacos() throws Exception {
        return this.storangeType;
    }
}
